using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UglyAnimals
{
    class Explosion:Entity
    {
        public Animation animation;


        public override Vector2 Position
        {
            get
            {
                return animation.Position;
            }

            set
            {
                animation.Position = value;
            }
        }

        // Get the width     
        public override int Width
        {
            get
            {
                return animation.FrameWidth;
            }
        }

        // Get the height
        public override int Height
        {
            get
            {
                return animation.FrameHeight;
            }
        }

        public void Initialize(Animation animation, Vector2 position)
        {
            this.animation = animation;
            Active = false;
        }

        public override void Update(GameTime gameTime)
        {
            animation.Update(gameTime);
            Active = animation.Active;
            if (Position.X < -Width)
            {
                Active = false;
            }
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            if (Active)
            {
                animation.Draw(spriteBatch);
            }
        }
    }
}
